local BBOY_TOUCH = Class(function(self, inst)
    self.inst = inst
    self.touching = false
end)

function BBOY_TOUCH:BeginTouch(doer)
    if not self.touching then
        self.touching = true
        if self.inst.cloud == nil then
            self.inst.cloud = SpawnPrefab("bboy_miasma_cloud")
            local x, y, z = self.inst.Transform:GetWorldPosition()
            self.inst.cloud.Transform:SetPosition(x, y, z)
            self.inst.cloud.persists = false -- 不保存,重载游戏后消失
        end
    else
        self.touching = false
        if self.inst.cloud ~= nil then
            self.inst.cloud:Remove()
            self.inst.cloud = nil
        end
    end
end

return BBOY_TOUCH
